package server.config;

import server.Servlet;

/**
 * Wrapper类对象
 * @author 陶肖寅
 * @version V1.0
 * @Package server.config
 * @date 2020-02-27 10:01
 * @Copyright © 2020-2021 城云科技(中国)有限公司
 */
public class Wrapper {
    /**
     * 类全限定命名
     */
    private String servletClass;
    /**
     * 存放对象的servlet
     */
    private Servlet servlet;
    /**
     * 存放urlpartten
     */
    private String urlPartten;

    /**
     * 传入servletClass构造出Wrapper对象
     * @param servletClass
     */

    public Wrapper(String servletClass) {
        this.servletClass = servletClass;
        try{
            Servlet servlet = (Servlet) Class.forName(servletClass).newInstance();
            this.servlet = servlet;
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public String getUrlPartten() {
        return urlPartten;
    }

    public void setUrlPartten(String urlPartten) {
        this.urlPartten = urlPartten;
    }

    public Servlet getServlet() {
        return servlet;
    }

    public void setServlet(Servlet servlet) {
        this.servlet = servlet;
    }

    public String getServletClass() {
        return servletClass;
    }

    public void setServletClass(String servletClass) {
        this.servletClass = servletClass;
    }
}
